# -*- coding = utf-8 -*-
# @Time : 2022/1/7 9:16
# @Author : 龙王赘婿_彪少
# @File : demo1.py
# @Software: PyCharm

from PIL import Image


# https://blog.csdn.net/MiniCatTwo/article/details/80565694

class IMG:
    ' picture deal'

    def __init__(self):
        self.read_img()

        # self.img.show()  # 显示

        self.print_information()

        # self.jpg_to_png()

    def read_img(self):
        # self.img = Image.open('../file/picture.png')
        self.img = Image.open("C:/Users/ThinkPad/Desktop/tag16/tag16_05_00000.png")

    def save_img(self):
        self.img.save("save.gif", "GIP")

    def print_information(self):
        (w, h) = self.img.size  # 大小
        print(w, h)
        print(self.img.format, self.img.size, self.img.mode)

    def jpg_to_png(self):
        img_temp = Image.open("../file/girl.jpg")
        img_temp.save("../file/girl2.png")


if __name__ == "__main__":
    obj = IMG()
